<template>
  <div class="layout_one">
    {{ title }}
  </div>
</template>
    
<script lang="ts">
import { defineComponent, reactive } from "vue";
import { useRoute, useRouter } from "vue-router";
import { getRouter } from "@/api/router";
import { convertRouter } from "@/utils/router";

export default defineComponent({
  name: "BanJi",
  setup() {
    const state = reactive({
      title: "这是班级",
    });

    const route = useRoute();
    const router = useRouter();

    console.log("route", route);

    // const getR = async () => {
    //   const { data } = await getRouter();
    //   const data2 = convertRouter(data);
    //   data2.forEach((element: any) => {
    //     router.addRoute(element);
    //   });
    //   console.log("router", router);
    // };

    // getR();

    return {
      ...state,
    };
  },
});
</script>
      
<style scoped>
.layout_one {
  background: #fff;
  padding: 20px;
  height: calc(100vh - 140px);
  box-shadow: 0 0 3px #e4e7ed;
}
.layout_one:hover {
  box-shadow: 0 0 5px #cdd0d6;
}
</style>